<?php
$this->breadcrumbs=array(
	'Distributor Products'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'List DistributorProduct', 'url'=>array('index')),
	array('label'=>'Manage DistributorProduct', 'url'=>array('admin')),
);
?>

<h1>Create DistributorProduct</h1>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'distributor-product-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'product_id'); ?>
		<?php echo CHtml::dropDownList('DistributorProduct[product]','',array(Product::model()->findByPk($model->product_id)->name),array('size'=>1, 'disabled' => 'disabled')); ?>
		<?php echo $form->error($model,'product_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'amount'); ?>
		<?php echo $form->textField($model,'amount'); ?>
		<?php echo $form->error($model,'amount'); ?>
	</div>
    
    
    <h3> <?php echo Shop::t('Payment method'); ?> </h3>
    <p> <?php echo Shop::t('Choose your Payment method'); ?> </p>
    <?php
    $i = 0;
    foreach(PaymentMethod::model()->findAll() as $method) {
        echo '<div class="row">';
        echo CHtml::radioButton("PaymentMethod", $i == 0, array(
                    'value' => $method->id));
        echo '<div class="float-left">';
        echo CHtml::label($method->title, 'PaymentMethod');
        echo CHtml::tag('p', array(), $method->description);
        echo '</div>';
        echo '</div>';
        echo '<div class="clear"></div>';
        $i++;
    }
	?>
    
    <h3> <?php echo Shop::t('Shipping Method'); ?> </h3>
    <p> <?php echo Shop::t('Choose your Shipping method'); ?> </p>

    <?php
    $i = 0;

    foreach(TransporterMethod::model()->findAll() as $method) {
        echo '<div class="row">';
        echo CHtml::radioButton("ShippingMethod", $i == 0, array(
                    'value' => $method->id));
        echo '<div class="float-left">';
        echo CHtml::label($method->title, 'ShippingMethod');
        echo CHtml::tag('p', array(), $method->description);
        echo CHtml::tag('p', array(), Shop::t('Price: ') . $method->unit_price.'/'.$method->unit);
        echo '</div>';
        echo '</div>';
        echo '<div class="clear"></div>';
        $i++;
    }
	?>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->